//
//  CaseImageCell.m
//  KMedicine
//
//  Created by song on 16/7/6.
//  Copyright © 2016年 caomu. All rights reserved.
//

#import "CaseImageCell.h"
#import "CaseModel.h"
@interface CaseImageCell()


@property (nonatomic, strong) UITapGestureRecognizer *tapgesture;


@end

@implementation CaseImageCell

- (instancetype)init{
    if (self = [super init]) {
        
        [self setupUI];
    }

    return self;
}


#pragma mark
#pragma mark 初始化控件
- (void)setupUI{
    
    self.addView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"compose_pic_add_highlighted"]];
    
    [self.contentView addSubview:self.addView];
    
    // 初始化手势识别
    self.tapgesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(addImage:)];
    [self.addView addGestureRecognizer:self.tapgesture];
    // imageView 开启用户交互
    [self.addView setUserInteractionEnabled:YES];
    
    [self setLayout];
}

#pragma mark
#pragma mark add手势识别方法
- (void)addImage:(UITapGestureRecognizer *)tap{
    
     _pickerBlock(self);
    
}


#pragma mark
#pragma mark 设置约束
- (void)setLayout{
    
    [self.textLabel makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(15);
    }];
    
    [self.addView makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(35);
        make.bottom.offset(-30);
        make.size.equalTo(CGSizeMake(80, 80));
    }];
    
}



@end
